﻿# CMakeList.txt: Library 的 CMake 项目，在此处包括源代码并定义项目特定的逻辑。
# 将源代码添加到此项目的可执行文件。
CMAKE_MINIMUM_REQUIRED(VERSION 3.31 FATAL_ERROR)

SET(MODULEID "Generic")

FILE(GLOB TESTFILE ${CMAKE_SOURCE_DIR}/NahidaProject-UnitTest/Sources/*.cpp ${CMAKE_SOURCE_DIR}/NahidaProject-UnitTest/Sources/*.h)
FILE(GLOB ALL_SOURCECODE ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/*.cpp)
FILE(GLOB ALL_HEADERFILE ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/*.h)
FILE(GLOB ALL_SOURCEANDTESTCODE ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/*.cpp ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Sources/*.h ${CMAKE_SOURCE_DIR}/NahidaProject-${MODULEID}/Tests/*.cpp)

ADD_EXECUTABLE(LibNahidaProject-${MODULEID}Tests ${ALL_SOURCEANDTESTCODE} ${TESTFILE})
ADD_LIBRARY(LibNahidaProject-${MODULEID}-IMPLEMENT STATIC ${ALL_SOURCECODE})
ADD_LIBRARY(LibNahidaProject-${MODULEID} SHARED ${ALL_SOURCECODE})

IF(CMAKE_VERSION VERSION_GREATER 3.12)
	SET_PROPERTY(TARGET LibNahidaProject-${MODULEID}Tests PROPERTY CXX_STANDARD 20)
	SET_PROPERTY(TARGET LibNahidaProject-${MODULEID}-IMPLEMENT PROPERTY CXX_STANDARD 20)
	SET_PROPERTY(TARGET LibNahidaProject-${MODULEID} PROPERTY CXX_STANDARD 20)
ENDIF()

MESSAGE(STATUS "Build module [${MODULEID}] done.")

target_link_libraries(LibNahidaProject-${MODULEID}Tests PUBLIC ws2_32)
target_link_libraries(LibNahidaProject-${MODULEID} PUBLIC ws2_32)
